package com.bf.electroplating.pojo.enums;

public enum FunctionEnums {

    CRUD("1", "操作权限"),
    ALL("21", "查看全部"),
    COMPANY("22", "所在公司"),
    BASE("23", "所在基地");

    private final String code;
    private final String desc;

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    private FunctionEnums(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static String getDesc(String code) {
        for (FunctionEnums item : FunctionEnums.values()) {
            if (item.getCode().equals(code)) {
                return item.getDesc();
            }
        }
        return null;
    }

}
